package view.model;

import controller.AppController;
import java.util.List;
import javax.swing.DefaultComboBoxModel;
import model.Animal;

/**
 *
 * @author BACQ Justine et SACRE Sauvane
 */

public class AnimalComboBoxModel extends DefaultComboBoxModel {

    private List<Animal> animalList;
    private AppController app = new AppController();

    public AnimalComboBoxModel(List<Animal> AnimalList) {
        this.animalList = AnimalList;
        for (Animal a : AnimalList) {
            this.addElement(a.getIdAnimal());
        }
    }

    public Animal getAnimal(int index) {
        return animalList.get(index);
    }
}
